﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

public partial class UserControl_LoginUser :System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

         HttpCookie userCookie = HttpContext.Current.Request.Cookies[ConfigurationManager.AppSettings["COOKIE_KEY_USER"] as string];
         try
         {
             if (userCookie != null)
             {


                 //_uid = Convert.ToInt32(userCookie.Values["id"]);
                 //_account = userCookie.Values["name"].ToString();
                 //_type = Convert.ToInt32(userCookie.Values["type"].ToString());
                 string userName = userCookie.Values["name"].ToString();
                 div_user.Style.Add("display", "");
                 div_reg.Style.Add("display", "none");
                 lab_account.InnerHtml = userName;
             }
             else
             {
                 div_user.Style.Add("display", "none");
                 div_reg.Style.Add("display", "");
             }
         }
         catch(Exception ex)
         {
             throw ex;
         }
    }

}